<form name="frmBlog" class="form-horizontal" ng-init="dvm.init()" ng-submit="dvm.save(frmBlog.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.cancel()">&times;</button>
    <h4 class="modal-title">编辑博客分类</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <label class="col-sm-2 control-label">分类名：</label>
      <div class="col-sm-10">
        <input name="category" type="text" class="form-control" ng-model="dvm.category" required autofocus
            maxlength="20" ng-class="{'x-invalid': frmBlog.$submitted && frmBlog.category.$invalid}">
        <p class="text-danger" ng-show="frmBlog.$submitted && frmBlog.category.$error.required">分类名不能为空</p>
        <p class="text-danger" ng-show="frmBlog.$submitted && dvm.existed">分类名已存在</p>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">顺序：</label>
      <div class="col-sm-10">
        <input name="order" type="number" class="form-control" min="2" max="{{dvm.maxOrder}}" ng-model="dvm.order"
            required ng-class="{'x-invalid': frmBlog.$submitted && frmBlog.order.$invalid}">
        <p class="text-danger" ng-show="frmBlog.$submitted && frmBlog.order.$invalid">顺序不在2~{{dvm.maxOrder}}的范围内</p>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button type="submit" class="btn btn-default" ng-disabled="frmBlog.$invalid">
      <i class="fa fa-save"></i> 保存</button>
    <button type="button" class="btn btn-default" ng-click="dvm.cancel()">
      <i class="fa fa-times"></i> 取消</button>
  </div>
</form>
